package com.xjk.nacosconfig9010.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: XJK
 */
@Controller
@RefreshScope // Nacos支持SpringCloud动态刷新的注解功能
public class MyController {

    @Value("${config.info}")
    private String configInfo;

    @RequestMapping("/configInfo")
    @ResponseBody
    public String getConfigInfo(){
        return configInfo;
    }

}
